﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Prj.Test
{
    using prj.Contracts;
    using System.ServiceModel;
    class Program
    {
        static void Main(string[] args)
        {
            using (ChannelFactory<ICalculator> channelFactory = new ChannelFactory<ICalculator>())
            {
                ICalculator calcuator = channelFactory.CreateChannel();
                using (calcuator as IDisposable)
                {
                    Console.WriteLine(String.Format("x+y={0} where x={1} and y={2}", calcuator.Add(1, 2), 1, 2));
                }
            }

            Console.ReadKey();
        }
    }
}
